package com.quizzer.system.convert;

import com.quizzer.common.utils.bean.BeanUtils;
import com.quizzer.system.domain.AppUser;
import com.quizzer.system.dto.user.appUser.AppUserAddDto;
import com.quizzer.system.dto.user.appUser.AppUserOutputDto;
import com.quizzer.system.dto.user.appUser.AppUserQueryDto;
import com.quizzer.system.dto.user.appUser.AppUserUpdateDto;

/**
 * @author rong
 * @Description
 * @date 2025/10/7 20:38
 */
public class AppUserConverter {
    public static AppUserOutputDto toOutputDto(AppUser entity) {
        if(entity == null) {
            return null;
        }
        AppUserOutputDto dto = new AppUserOutputDto();
        BeanUtils.copyBeanProp(dto,entity);
        return dto;
    }
    public static AppUser toEntity(AppUserAddDto dto) {
        if(dto == null) {
            return null;
        }
        AppUser entity = new AppUser();
        BeanUtils.copyBeanProp(entity,dto);
        return entity;
    }
    public static AppUser toEntity(AppUserUpdateDto dto) {
        if(dto == null) {
            return null;
        }
        AppUser entity = new AppUser();
        BeanUtils.copyBeanProp(entity,dto);
        return entity;
    }
    public static AppUser toEntity(AppUserQueryDto dto) {
        if(dto == null) {
            return null;
        }
        AppUser entity = new AppUser();
        BeanUtils.copyBeanProp(entity,dto);
        return entity;
    }
}
